package study.itheima.Test21;
public class Student {
    private String name;    //姓名
    private int ywScore;    //语文成绩
    private int sxScore;    //数学成绩
    private int yyScore;    //英语成绩

    public Student() {
    }

    public Student(String name, int ywScore, int sxScore, int yyScore) {
        this.name = name;
        this.ywScore = ywScore;
        this.sxScore = sxScore;
        this.yyScore = yyScore;
    }
    //定义总分方法
    public int sum(){
        return ywScore+sxScore+yyScore;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getYwScore() {
        return ywScore;
    }

    public void setYwScore(int ywScore) {
        this.ywScore = ywScore;
    }

    public int getSxScore() {
        return sxScore;
    }

    public void setSxScore(int sxScore) {
        this.sxScore = sxScore;
    }

    public int getYyScore() {
        return yyScore;
    }

    public void setYyScore(int yyScore) {
        this.yyScore = yyScore;
    }

    @Override
    public String toString() {
        return name + "," + ywScore + "," + sxScore + "," + yyScore;
    }
}
